package cn.git.shiro.enums;

import lombok.Getter;

/**
 * @description: DMZ网关响应enum
 * @program: bank-credit-sy
 * @author: lixuchun
 * @create: 2024-01-05 10:20:51
 */
@Getter
public enum ResultEnum {

    /**
     * 交易枚举类型
     */
    SUCCESS(true, "0000", "交易成功!", "交易成功!"),
    NORMAL_ERROR(false, "000X", "代码异常!", "请联系供应商!"),
    DECRYPT_ERROR(false, "000X", "解密入参失败!", "请确认请求信息是否正确!"),
    REQUEST_METHOD_ERROR(false, "0001", "请求方法必须为post方法!", "请确认请求方式!"),
    REQUEST_NO_BODY_ERROR(false, "0002", "请求信息没有请求体!", "请确认请求信息是否正确!"),
    SIGN_VALID_FORMAT_ERROR(false, "0003", "验签请求信息补全!", "请确认请验签请求信息是合法!"),
    SIGN_VALID_ERROR(false, "0004", "验签失败!", "验签失败!"),
    REQUEST_PARAM_VALID_ERROR(false, "0005", "请求参数格式校验失败!", "请求参数格式校验失败!"),
    REQUEST_PARAM_TRANSCODE_ERROR(false, "0006", "transcode解析失败!", "请确认请求参数transcode!"),
    REQUEST_GET_TRAIN_ERROR(false, "0007", "获取TRAN执行类失败!", "请联系供应商!"),
    CUSTOM_TRAIN_ERROR(false, "0008", "自定义异常信息!", "请联系供应商!"),
    ;

    /**
     * 是否成功
     * true/false
     */
    private boolean issuccess;

    /**
     * 响应编码
     * 0000 成功
     */
    private String rtncode;

    /**
     * 响应消息
     * 交易成功/交易失败
     */
    private String rtnmessage;

    /**
     * 支持信息
     * 请联系服务商
     */
    private String solution;

    /**
     * 构造函数
     *
     * @param issuccess
     * @param rtncode
     * @param rtnmessage
     * @param solution
     */
    ResultEnum(boolean issuccess, String rtncode, String rtnmessage, String solution) {
        this.issuccess = issuccess;
        this.rtncode = rtncode;
        this.rtnmessage = rtnmessage;
        this.solution = solution;
    }

}
